package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.pojo.CheckGroup;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckgroupMapper {
    /**
     *
     * @param checkGroup
     */
    void add(CheckGroup checkGroup);

    /**
     * 根据id删除检查组
     * @param groupId
     */
    @Delete("delete from t_checkgroup where id = #{groupId}")
    void deleteById(Integer groupId);

    /**
     * 编辑
     * @param checkGroup
     */
    void edit(CheckGroup checkGroup);

    /**
     * 查询所有检查组
     * @return
     */
    @Select("select * from t_checkgroup;")
    List<CheckGroup> findAll();

    /**
     * 根据id查询检查组
     * @param id
     * @return
     */
    @Select("select * from t_checkgroup where id = #{id};")
    CheckGroup findById(Integer id);

    /**
     * 分页查询
     * @param queryString
     * @return
     */
    Page<CheckGroup> findPage(String queryString);

}
